<template>
 <div class="header">
   <div class="header-title">{{$store.state.title}}</div>
   <div class="header-back" v-if="showBack" @click="goBack">返回</div>
 </div>
</template>
<script>
export default {
  data () {
    return {}
  },
  props: {
    showBack: {
      default: false,
      type: Boolean
    }
  },
  methods: {
    goBack() {
      this.$router.go(-1)
    }
  },
  components: {}
}
</script>
<style lang="scss" scoped>
.header{
  width: 100%;
  height: 40px;
  line-height: 40px;
  text-align: center;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #ff9500;
  font-size: 14px;
  color: #fff;
  .header-back{
    padding-left: 15px;
    position: fixed;
    top: 0;
    left: 0;
  }
}
</style>
